﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.TrainingsRequestsExt>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Планирование выездного курса по заявке
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Планирование выездного курса по заявке</h2>

<%
    var citiesCol = new CRM.Database.Model.TrainingsCitiesCollection();
    var placesCol = new CRM.Database.Model.TrainingsPlacesCollection(); 
    //var statusesCol = new CRM.Database.Model.TrainingCoursesStatusesCollection();
%>

<% using (Html.BeginForm("TrainingsPlannedRequestEdit"))
       {

           //var trainersCol = new CRM.Database.Model.TrainingsTrainersCollection();       
%>

       <%: Html.ValidationSummary(true) %>
    <%:Html.Hidden("Request.IdTrainingsRequest")%>
    <%:Html.Hidden("Request.IdTrainingsRequestsStatus")%>
    <%:Html.Hidden("Request.IdCustomer")%>
    <%:Html.Hidden("Request.RequestDate")%>
    <%:Html.Hidden("Request.FirstDate")%>
    <%:Html.Hidden("Request.LastDate")%>
    <%:Html.Hidden("Key") %>

    <br />
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Выездной курс";
                      settings.Width = 500;
                  }).GetHtml() %>
    <% Html.RenderPartial("TrainingsRemoteRequestEditCoursesPartial"); %>

    <table>
        <tr>
            <td>
                <%:Html.DevExpress().Label(
                  settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Целевая аудитория:";
                      settings.Width = 247;
                  }).GetHtml() %>
            </td>
            <td>
                <%:Html.DevExpress().Label(
                  settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Кол-во участников:";
                      settings.Width = 247;
                  }).GetHtml() %>
            </td>
        </tr>
        <tr>
            <td>
                <% Html.RenderPartial("TrainingsRemoteRequestEditAuditoriumsPartial"); %>
            </td>
            <td>
                <%:Html.DevExpress().SpinEdit(
                    settings =>
                    {
                        settings.Name = "Request.PredictParticipantsCount";
                        settings.ControlStyle.CssClass = "editor";
                        //settings.Properties.DisplayFormatString = "N1";
                        //settings.Properties.Increment = (decimal)0.5;
                        settings.Width = 247;
                    }).Bind(Model.Request.PredictParticipantsCount).GetHtml()%>
            </td>
        </tr>
    </table>

    <br />
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Возможные сроки проведения:";
                      settings.Width = 500;
                  }).GetHtml() %>
    <table>
        <tr>
            <td>
            <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "C:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
            <td>
            <%:Html.DevExpress().DateEdit(settings =>
                {
                    settings.Name = "Request.FirstDate1";
                    settings.Properties.DisplayFormatString = "D";
                    settings.Width = 120;
                    settings.Enabled = false;
                    settings.ReadOnly = true;
                }).Bind(Model.Request.FirstDate).GetHtml()%>
            </td>
            <td>
            <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "По:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
            <td>
            <%:Html.DevExpress().DateEdit(settings =>
                {
                    settings.Name = "Request.LastDate1";
                    settings.Properties.DisplayFormatString = "D";
                    settings.Width = 120;
                    settings.Enabled = false;
                    settings.ReadOnly = true;
                }).Bind(Model.Request.LastDate).GetHtml() %>
            </td>
        </tr>
    </table>
    
    <table>
        <tr>
            <td>
                <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Дата проведения:";
                      settings.Width = 120;
                  }).GetHtml() %>
            </td>
            <td>
                <%:Html.DevExpress().DateEdit(settings =>
                {
                    settings.Name = "ScheduleDate";
                    settings.Properties.DisplayFormatString = "D";
                    settings.Width = 120;
                }).Bind(Model.ScheduleDate).GetHtml() %>
            </td>
            <td>
                <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Тренер";
                      settings.AssociatedControlName = "IdRubric";
                      settings.Width = 120;
                  }).GetHtml()%>
            </td>
            <td>
                <% Html.RenderPartial("TrainingsRemoteRequestEditTrainersPartial"); %>
            </td>
        </tr>
    </table>
    
    <table>
        
        <tr>
            <td>
                <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Название юр. лица";
                      settings.Width = 232;
                  }).GetHtml() %>
                <%: Html.Partial("TrainingsRequestLEPartial", Model)%>
                
            </td>
            <td>
                
            </td>
        </tr>
        <tr>
            <td>
                <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Контакты";
                      settings.Width = 232;
                  }).GetHtml() %>
                <%: Html.Partial("TrainingsRequestContactPartial", Model)%>
                
            </td>
            <td>
                
            </td>
        </tr>
    </table>
    <br />
    
    <table>
        <tr>
            <td>
                <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Заявленный город";
                      settings.Width = 247;
                  }).GetHtml() %>
            </td>
            <td>
                <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Город проведения";
                      settings.Width = 247;
                  }).GetHtml()%>
            </td>
        </tr>
        <tr>
            <td>
                <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.Company";
                        settings.Width = 247;
                        settings.ReadOnly = true;
                        //settings.Enabled = false;
                        //settings.Properties.NullText = "Введите город проведения";
                    }).Bind(Model.Request.Company).GetHtml()%>
            </td>
            <td>
                <%: Html.DevExpress().ComboBox(settings =>
                  {
                      settings.Name = "IdTrainingsCity";
                      settings.ControlStyle.CssClass = "editor";
                      settings.Properties.TextField = "TrainingsCityName";
                      settings.Properties.ValueField = "IdTrainingsCity";
                      settings.Properties.ValueType = typeof (int);
                      settings.Width = 247;
                  }).BindList(citiesCol.TrainingsCitiesList.OrderBy(p => p.TrainingsCityName)).Bind(Model.IdTrainingsCity).GetHtml()%>
            </td>
        </tr>
    </table>
    <br />
    
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Площадка:";
                      settings.Width = 500;
                  }).GetHtml() %>
    <% Html.RenderPartial("TrainingsRemoteRequestEditPlacesPartial"); %>
    
    <br />
    
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Причина";
                      settings.Width = 500;
                  }).GetHtml() %>
    <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.Reason";
                        settings.Width = 500;
                        settings.Properties.NullText = "Введите причину подачи заявки";
                    }).Bind(Model.Request.Reason).GetHtml()%>

    <br />
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Комментарий";
                      settings.Width = 500;
                  }).GetHtml() %>
    <%:Html.DevExpress().TextBox( settings => 
                    {
                        settings.Name = "Request.Comments";
                        settings.Width = 500;
                        settings.Properties.NullText = "Комментарии...";
                    }).Bind(Model.Request.Comments).GetHtml()%>

    <br />
    <%:Html.DevExpress().Label(
              settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Участники";
                      settings.Width = 500;
                  }).GetHtml() %>
    <% Html.RenderPartial("TrainingsParticipantsPartial"); %>

       <button type="submit" value="Создать заявку">Сохранить изменения</button>
    <% } %>

</asp:Content>
